function sendRequest() {
  // Content-Type: application/json
  const json = JSON.stringify({
    name: '张智琦',
    age: 18
  })

  const xhr = new XMLHttpRequest()
  xhr.open('POST', 'http://127.0.0.1/api/post/json')
  xhr.setRequestHeader('Content-Type', 'application/json')
  xhr.onreadystatechange = () => {
    if (xhr.readyState === XMLHttpRequest.DONE) {
      if (xhr.status === 200) {
        const res = xhr.response
        console.log(res)
      }
    }
  }
  xhr.send(json)
}
